<uieip type="page" value="base" debug="true" timeout="5000"></uieip>
<uieip type="reg" value="data"></uieip>
<script runat="server">
    var action = request.param("action");
    var dbName = request.param("dbname");
	var tbName = request.param("tbname");
    var b_json="{}";
    if(action=="dbs"){
        b_json=data.dbs();
    } else if(action=="title"){
        var tempno = request.param("tempno");
        b_json=data.title(dbName,tbName,tempno);
    } else if(action=="model"){
        var tempno = request.param("tempno");
        b_json=data.model(dbName,tbName,tempno);
    } else if(action=="select"){
        var where = request.param("where");
        var order = request.param("order");
        b_json=data.select(dbName,tbName,where,order);
    } else if(action=="paging"){
        var where = request.param("where");
        var order = request.param("order");
        var pageSize = request.param("pageSize");
        var pageNo = request.param("pageNo");
        b_json=data.paging(dbName,tbName,where,order,pageSize,pageNo);
    } else if(action=="query"){
        var sql = request.param("sql");
        b_json=data.query(dbName,tbName,sql);
    } else if(action=="row"){
        var keyid = request.param("keyid");
        var keyval = request.param("keyval");
        b_json=data.row(dbName,tbName,keyid,keyval);
    } else if(action=="foreignkey"){
        var json_ = request.param("json");
        b_json=data.foreignkey(json_);
    } else if(action=="action"){
        var json_ = request.param("json");
        b_json=data.action(dbName,tbName,JSON.parse(json_));
    } else {
        b_json=data.infojson(99,action + "操作不存在。");
    }
    response.write(JSON.stringify(b_json));
</script>